/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.upc.clase.demo.service.impl;

import edu.upc.clase.demo.dao.LocalDao;
import edu.upc.clase.demo.dao.impl.LocalDaoImpl;
import edu.upc.clase.demo.entity.Local;
import edu.upc.clase.demo.service.LocalService;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 *
 * @author Jose Vasquez
 */
@Service
public class LocalServiceImpl implements LocalService {
     private static Logger log = LoggerFactory.getLogger(LocalDaoImpl.class);
    
    @Autowired
    private LocalDao localDao;
  
      @Override
    public Integer insertar(Local local) {
        log.info("Creando local");
        return localDao.insertar(local);
    }
    
    @Override
    public void actualizar(Local local) {
        log.info("Actualizando local");
        localDao.actualizar(local);
    }
     
    @Override
    public void eliminar(Local local) {
        log.info("Eliminando local");
        localDao.eliminar(local);
    } 
    
    @Override
    public List<Local> buscarTodos() {
        log.info("Buscando todos los locales");
        return localDao.buscarTodos();
    }
     
    @Override
    public Local buscar(Integer CoLocal) {
        log.info("Buscar local por id");
        return localDao.buscar(CoLocal);
    }
    
     @Override
    public List<Local> buscarPorNombre(String nolocal) {
        return localDao.buscarPorNombre(nolocal);
    }
}
